package info.mikazuchi.yokoid;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
	private int cntr;
	private int img_ID[]={
							0,
							R.drawable.droidgreen,
							R.drawable.droidblack
						};
	private ImageView imgDroid;//

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //
        imgDroid=(ImageView)findViewById(R.id.ImageView01);
        imgDroid.setOnClickListener(new ImageViewOnClick());
        //
    }
    public class ImageViewOnClick implements OnClickListener {
    	public void onClick(View v){
    		switch(cntr){
    		case 1:
    			cntr=2;
    			break;
    		case 2:
    			cntr=1;
    			break;
    		default:
    			cntr=1;
    			break;
    		}

    		imgDroid.setImageResource(img_ID[cntr]);
    	}
    }
}